//
//  intputname.m
//  releaseInterface
//
//  Created by Gamefire on 16/4/14.
//  Copyright © 2016年 Gamefire. All rights reserved.
//

#import "intputname.h"
//#import "IQKeyboardManager.h"
#import "Header.h"

//#define  UIColorRGBA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]

//#define kWindowWidth                        ([[UIScreen mainScreen] bounds].size.width)

//#define kWindowHeight                       ([[UIScreen mainScreen] bounds].size.height)
@interface intputname ()<UITextFieldDelegate>{

    UITextField *intputfield;

}
@end
@implementation intputname
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        intputfield = [[UITextField alloc] initWithFrame:CGRectMake(20, 20, self.bounds.size.width, 54)];
        [intputfield setBorderStyle:UITextBorderStyleNone];
        [intputfield setDelegate:self];
        [intputfield setPlaceholder:@"请为您的作品留下主题文字"];
        [intputfield addTarget:self action:@selector(textDidChange:) forControlEvents:UIControlEventEditingChanged];
        [self addSubview:intputfield];
        
        
        UILabel *headinglabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, WithView, 20)];
        [headinglabel setBackgroundColor:uicolor(237, 237, 237)];
        [headinglabel setText:@"   标题"];
        [headinglabel setTextColor:uicolor(102, 102, 102)];
        [headinglabel setFont:[UIFont systemFontOfSize:11.0]];
        
        [self addSubview:headinglabel];
//        [headinglabel setBackgroundColor:[UIColor redColor]];
        
        [self setBackgroundColor:[UIColor whiteColor]];
           }
    return self;
}


- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [intputfield resignFirstResponder];
    return YES;
}


- (void)textDidChange:(UITextField *)sender
{
    [_MinputtextfildDelegate writeTitle:sender.text];
}



@end
